package cn.edu.hbpu.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author lcy
 * @date 2022/8/7 16:09
 * @description 购物车
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("cart")
public class Cart {
    /**
     * 商品id
     */
    @JsonProperty("gId")
    private String gId;
    /**
     * 该商品是否被选中
     */
    @JsonProperty("checked")
    private Integer checked;
    /**
     * 购物数量
     */
    @JsonProperty("amount")
    private Long amount;
    /**
     * 用户id
     */
    @JsonProperty("userId")
    private String userId;

    @TableField(fill = FieldFill.INSERT)
    @JsonProperty("createTime")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonProperty("updateTime")
    private LocalDateTime updateTime;
}
